package cn.fl.mcr.service.impl;

import cn.fl.mcr.service.IMcrMonitorCheckService;
import cn.lionbridgecapital.loan.model.base.Pager;
import cn.lionbridgecapital.loan.model.dto.McrMonitorCheckDDTO;
import cn.lionbridgecapital.loan.model.exception.BaseException;
import cn.lionbridgecapital.loan.model.exception.BaseExceptionConstant;
import cn.lionbridgecapital.loan.model.utils.StringUtils;
import cn.lionbridgecapital.loan.service.api.IMonitorCheckApiService;
import cn.lionbridgecapital.loan.utils.BaseLogUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * @Description: 卓远对账表 客户端服务层接口实现
 * @Description: 业务层方法名称前缀：新增：add* 删除：remove* 修改：modify* 查询对象：select* get* 批量：batch* 查询集合：search*
 */
@Service
public class McrMonitorCheckServiceImpl implements IMcrMonitorCheckService {

	/**
	 * 日志
	 */
	private static final Logger logger = LoggerFactory.getLogger(McrMonitorCheckServiceImpl.class);
	
	/**
	 * 自定义 API 自行注入需要的API服务
	 */
	@Autowired
	private IMonitorCheckApiService monitorCheckApiService;

	@Override
	public List<McrMonitorCheckDDTO> selectDtlById(Long id) throws BaseException {
		if(StringUtils.isEmpty(id)){
			BaseLogUtils.info(logger, "selectById", "主键参数不能为空!");
			throw new BaseException(BaseExceptionConstant.BASE_EXCEPTION_CODE_600, "获取对象主键不能为空!");
		}
		//TODO 业务逻辑
		return monitorCheckApiService.selectCheckDtl(id);
	}

	@Override
	public Pager searchListPage(Pager page) throws BaseException{
		if(null == page){
			page = new Pager();
		}
		return this.monitorCheckApiService.searchListPage(page);
	}
}
